{include file='public/header'}
<body>
	{include file="public/top_bar"} {include file="public/left_menu"}
	<div class="page-content" style="overflow: scroll;">
		<div class="x-body">
			<table class="layui-table">
				<tbody>
					<tr style="background: #eee;color: #000;">
						<td width="5%" class="ac">ID</td>
						<td width="30%">活动名称</td>
						<td width="15%" class="ac">创建时间</td>
						<td width="10%" class="ac">浏览数</td>
						<td width="10%" class="ac">报名数</td>
						<td width="10%" class="ac">转发数</td>
						<td class="ac">操作</td>
					</tr>
					{volist name="activity" id="vo"}
					<tr>
						<td width="5%" class="ac">
							<a href="javascript:void(0);">
								{$vo['id']}
							</a>
						</td>
						<td width="30%">
							<a href="" class="text-underline">
								{$vo['activity_title']}
							</a>
						</td>
						<td width="15%" class="ac">
							<a href="javascript:void(0);">
								{$vo['create_time']|date="Y-m-d h:i:s",###}
							</a>
						</td>
						<td width="10%" class="ac">
							<a href="javascript:void(0);">
								214
							</a>
						</td>
						<td width="10%" class="ac">
							<a href="javascript:void(0);">
								95
							</a>
						</td>
						<td width="10%" class="ac">
							<a href="javascript:void(0);">
								1
							</a>
						</td>
						<td class="ac">
							<a href="javascript:void(0);" class="text-underline" onclick="x_admin_show('编辑活动','{:url("user/Manage/activity_edit", ["id"=>$vo.id])}', '100vw','100vh')">
								编辑
							</a>
							<a href="javascript:void(0);" class="text-underline" style="margin-left: 15px;">
								数据
							</a>
							<a href="javascript:void(0);" class="text-underline" style="margin-left: 15px;" 
								onclick="copyUrl('{:url("index/Index/view", ["id" => $vo.id])}');"
							>
								复制链接
							</a>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
		</div>
	</div>
	<div class="page-content-bg"></div>
	{include file="public/footer"} {include file="public/base_js"}
	<script type="text/javascript">
		function copy(text) {
			if (window.clipboardData && window.clipboardData.setData) {
				return window.clipboardData.setData('Text', text);
			} else if(document.queryCommandSupported && document.queryCommandSupported('copy')){
				var textarea = document.createElement('textarea');
				textarea.textContent = text;
				textarea.style.position = 'fixed';
				document.body.appendChild(textarea);
				textarea.select();
				try {
					return document.execCommand('copy');
				} catch(e) {
					return false;
				} finally {
					document.body.removeChild(textarea);
				}
			}
		}
		function copyUrl(text) {
			var res = copy('https://edu.qian-hong.com' + text);
			if (res) {
				layer.msg('复制成功，可直接使用粘贴', {
					'icon':1,
					'time': 1000
				});
			}
		}

	</script>
</body>

</html>